package com.ftg.learn.chapter09.say;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author kangjx
 * @version 1.0
 * @date 2023/8/14 下午3:16
 */
public class C {

    public static void main(String[] args) {

        A a1 = new A();
        a1.setColor("red");

        //set用来赋値 right
//        a1.setBlist();
//        a1.blist.add(new B());
        a1.getBlist().add(new B());


        List<B> blists = new ArrayList<>();
        a1.setBlist(blists);

        System.out.println(a1.getBlist());

//        B[] bs = new B[2];
//        bs[0] = new B();
//        bs[1] = new B();
//
//        A a1 = new A();
//        a1.setColor("颜色");
//        a1.setBs(bs);
////        a1.setBs(new B[2]);
//
//        //1 取数组
//        a1.getBs()[0] = new B();
//
//        B b1 = new B();
//        b1.setName("张三");
//        a1.getBs()[1] = b1;
//
//        System.out.println(Arrays.toString(a1.getBs()));
    }

}
